#include <iostream>
#include <algorithm>
using namespace std;
bool cmp(int a, int b) {
    return a>b;
}
int main() {
    int n;
    while(cin>>n && n!=0) {
        int tian[n];
        for(int i=0; i<n; i++) {
            cin>>tian[i];
        }
        int king[n];
        for(int i=0; i<n; i++) {
            cin>>king[i];
        }
        sort(tian,tian+n,cmp);
        sort(king,king+n,cmp);
        int win=0;
        int ping=0;
        int tiankuai=0,tianman=n-1;
        int kingkuai=0,kingman=n-1;
        while(tiankuai<=tianman&&kingkuai<=kingman) {
            if(tian[tiankuai]>king[kingkuai]) {
                win++;
                tiankuai++;
                kingkuai++;
            }
            else if(tian[tiankuai]<king[kingkuai]) {
                tianman--;
                kingkuai++;
            }
            else if(tian[tiankuai]==king[kingkuai]) {
                while(tian[tianman]>king[kingman]) {
                    tianman--;
                    kingman--;
                    win++;
                }
                if(tian[tianman]<king[kingkuai]) {
                    tianman--;
                    kingkuai++;
                }
                else {
                    tiankuai++;
                    kingkuai++;
                    ping++;
                }
            }
        }
/*        int c1=0;
        for(int i=0,j=0; i<n&&j<n; ) {
            if(tian[i]>king[j]) {
                i++;
                j++;
                c1++;
            }
            else j++;
        }*/
        int a1=2*win-n+ping;
//        int a2=2*c1-n;
//        int max=(a1>a2?a1:a2);
//        cout<<c<<' '<<ping<<' '<<n-c-ping<<endl;
        cout<<a1*200<<endl;
    }
    return 0;
}
